home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / MachineExceptions.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  6.5 KB  |  173 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        MachineExceptions.a
  3. ;
  4. ;    Contains:    Processor Exception Handling Interfaces .
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__MACHINEEXCEPTIONS__') = 'UNDEFINED' THEN
  21. __MACHINEEXCEPTIONS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28. ; typedef KernelID             AreaID
  29. ; Machine Dependent types for PowerPC: 
  30. MachineInformationPowerPC RECORD    0
  31. CTR                         ds     UnsignedWide ; offset: $0 (0)
  32. LR                         ds     UnsignedWide ; offset: $8 (8)
  33. PC                         ds     UnsignedWide ; offset: $10 (16)
  34. CR                         ds.l   1        ; offset: $18 (24)
  35. XER                         ds.l   1        ; offset: $1C (28)
  36. MSR                         ds.l   1        ; offset: $20 (32)
  37. sizeof                     EQU *            ; size:   $24 (36)
  38.                         ENDR
  39.  
  40. ; typedef struct MachineInformationPowerPC  MachineInformationPowerPC
  41. RegisterInformationPowerPC RECORD    0
  42. R0                         ds     UnsignedWide ; offset: $0 (0)
  43. R1                         ds     UnsignedWide ; offset: $8 (8)
  44. R2                         ds     UnsignedWide ; offset: $10 (16)
  45. R3                         ds     UnsignedWide ; offset: $18 (24)
  46. R4                         ds     UnsignedWide ; offset: $20 (32)
  47. R5                         ds     UnsignedWide ; offset: $28 (40)
  48. R6                         ds     UnsignedWide ; offset: $30 (48)
  49. R7                         ds     UnsignedWide ; offset: $38 (56)
  50. R8                         ds     UnsignedWide ; offset: $40 (64)
  51. R9                         ds     UnsignedWide ; offset: $48 (72)
  52. R10                         ds     UnsignedWide ; offset: $50 (80)
  53. R11                         ds     UnsignedWide ; offset: $58 (88)
  54. R12                         ds     UnsignedWide ; offset: $60 (96)
  55. R13                         ds     UnsignedWide ; offset: $68 (104)
  56. R14                         ds     UnsignedWide ; offset: $70 (112)
  57. R15                         ds     UnsignedWide ; offset: $78 (120)
  58. R16                         ds     UnsignedWide ; offset: $80 (128)
  59. R17                         ds     UnsignedWide ; offset: $88 (136)
  60. R18                         ds     UnsignedWide ; offset: $90 (144)
  61. R19                         ds     UnsignedWide ; offset: $98 (152)
  62. R20                         ds     UnsignedWide ; offset: $A0 (160)
  63. R21                         ds     UnsignedWide ; offset: $A8 (168)
  64. R22                         ds     UnsignedWide ; offset: $B0 (176)
  65. R23                         ds     UnsignedWide ; offset: $B8 (184)
  66. R24                         ds     UnsignedWide ; offset: $C0 (192)
  67. R25                         ds     UnsignedWide ; offset: $C8 (200)
  68. R26                         ds     UnsignedWide ; offset: $D0 (208)
  69. R27                         ds     UnsignedWide ; offset: $D8 (216)
  70. R28                         ds     UnsignedWide ; offset: $E0 (224)
  71. R29                         ds     UnsignedWide ; offset: $E8 (232)
  72. R30                         ds     UnsignedWide ; offset: $F0 (240)
  73. R31                         ds     UnsignedWide ; offset: $F8 (248)
  74. sizeof                     EQU *            ; size:   $100 (256)
  75.                         ENDR
  76.  
  77. ; typedef struct RegisterInformationPowerPC  RegisterInformationPowerPC
  78. FPUInformationPowerPC     RECORD    0
  79. Registers                 ds.b   32 * UnsignedWide.sizeof ; offset: $0 (0)
  80. FPSCR                     ds.l   1        ; offset: $100 (256)
  81. Reserved                 ds.l   1        ; offset: $104 (260)
  82. sizeof                     EQU *            ; size:   $108 (264)
  83.                         ENDR
  84.  
  85. ; typedef struct FPUInformationPowerPC  FPUInformationPowerPC
  86.  
  87. kWriteReference                    EQU        0
  88. kReadReference                    EQU        1
  89. kFetchReference                    EQU        2
  90. writeReference                    EQU        kWriteReference        ; Obsolete name
  91. readReference                    EQU        kReadReference        ; Obsolete name
  92. fetchReference                    EQU        kFetchReference        ; Obsolete name
  93.  
  94. ; typedef unsigned long     MemoryReferenceKind
  95. MemoryExceptionInformation RECORD    0
  96. theArea                     ds.l   1        ; offset: $0 (0)
  97. theAddress                 ds.l   1        ; offset: $4 (4)
  98. theError                 ds.l   1        ; offset: $8 (8)
  99. theReference             ds.l   1        ; offset: $C (12)
  100. sizeof                     EQU *            ; size:   $10 (16)
  101.                         ENDR
  102.  
  103. ; typedef struct MemoryExceptionInformation  MemoryExceptionInformation
  104.  
  105. kUnknownException                EQU        0
  106. kIllegalInstructionException    EQU        1
  107. kTrapException                    EQU        2
  108. kAccessException                EQU        3
  109. kUnmappedMemoryException        EQU        4
  110. kExcludedMemoryException        EQU        5
  111. kReadOnlyMemoryException        EQU        6
  112. kUnresolvablePageFaultException    EQU        7
  113. kPrivilegeViolationException    EQU        8
  114. kTraceException                    EQU        9
  115. kInstructionBreakpointException    EQU        10
  116. kDataBreakpointException        EQU        11
  117. kIntegerException                EQU        12
  118. kFloatingPointException            EQU        13
  119. kStackOverflowException            EQU        14
  120. kTerminationException            EQU        15
  121. unknownException                EQU        kUnknownException    ; Obsolete name
  122. illegalInstructionException        EQU        kIllegalInstructionException ; Obsolete name
  123. trapException                    EQU        kTrapException        ; Obsolete name
  124. accessException                    EQU        kAccessException    ; Obsolete name
  125. unmappedMemoryException            EQU        kUnmappedMemoryException ; Obsolete name
  126. excludedMemoryException            EQU        kExcludedMemoryException ; Obsolete name
  127. readOnlyMemoryException            EQU        kReadOnlyMemoryException ; Obsolete name
  128. unresolvablePageFaultException    EQU        kUnresolvablePageFaultException ; Obsolete name
  129. privilegeViolationException        EQU        kPrivilegeViolationException ; Obsolete name
  130. traceException                    EQU        kTraceException        ; Obsolete name
  131. instructionBreakpointException    EQU        kInstructionBreakpointException ; Obsolete name
  132. dataBreakpointException            EQU        kDataBreakpointException ; Obsolete name
  133. integerException                EQU        kIntegerException    ; Obsolete name
  134. floatingPointException            EQU        kFloatingPointException ; Obsolete name
  135. stackOverflowException            EQU        kStackOverflowException ; Obsolete name
  136. terminationException            EQU        kTerminationException ; Obsolete name
  137.  
  138. ; typedef unsigned long     ExceptionKind
  139. ExceptionInfo             RECORD    0
  140. memoryInfo                 ds.l   1        ; offset: $0 (0)
  141.                          ORG 4
  142. sizeof                     EQU *            ; size:   $4 (4)
  143.                         ENDR
  144.  
  145. ; typedef union ExceptionInfo  ExceptionInfo
  146. ExceptionInformationPowerPC RECORD    0
  147. theKind                     ds.l   1        ; offset: $0 (0)
  148. machineState             ds.l   1        ; offset: $4 (4)
  149. registerImage             ds.l   1        ; offset: $8 (8)
  150. FPUImage                 ds.l   1        ; offset: $C (12)
  151. info                     ds.l   1        ; offset: $10 (16)
  152. sizeof                     EQU *            ; size:   $14 (20)
  153.                         ENDR
  154.  
  155. ; typedef struct ExceptionInformationPowerPC  ExceptionInformationPowerPC
  156.     IF GENERATINGPOWERPC  THEN
  157. ; typedef ExceptionInformationPowerPC  ExceptionInformation
  158. ; typedef MachineInformationPowerPC  MachineInformation
  159. ; typedef RegisterInformationPowerPC  RegisterInformation
  160. ; typedef FPUInformationPowerPC  FPUInformation
  161.     ENDIF
  162. ; Note:    An ExceptionHandler is NOT a UniversalProcPtr.
  163. ;            It must be a native function pointer with NO routine descriptor. 
  164. ; Routine for installing per-process exception handlers 
  165. ;
  166. ; pascal ExceptionHandler InstallExceptionHandler(ExceptionHandler theHandler)
  167. ;
  168.     IF GENERATINGCFM THEN
  169.         IMPORT_CFM_FUNCTION    InstallExceptionHandler
  170.     ENDIF
  171.  
  172.     ENDIF ; __MACHINEEXCEPTIONS__
  173.